<!--
 * @Descripttion: 
 * @version: 
 * @Author: 
 * @Date: 2022-04-24 08:59:45
 * @LastEditors: weidelong
 * @LastEditTime: 2022-05-06 16:13:14
-->
<template>
    <div class="main">
        <router-view></router-view>
    </div>
	<bottomTab></bottomTab>
</template>

<script>
import bottomTab from '@/components/bottomTab/bottom.vue'

export default {
    name: "index",
    components: { bottomTab },
    data() {
        return {
            state: false
        };
    },
    methods: {},
    mounted() {
        try {
            const token = sessionStorage.getItem('token')
            if (token) {
                this.$socket.connect()
            }
        } catch (error) {
            console.log(error)
        }
        
        this.sockets.subscribe('isLine', data => {
            if (data) {
                sessionStorage.setItem('state', data.state)
            }
        })
	}
};
</script>

<style lang="scss" scoped>
    .main {
        width: 100%;
        height: calc(100% - 50px);
    }
</style>